from moviepy.editor import *
from animation.editor import *
from common.video_tools import add_subtitles

'''
5.	视频字幕
'''
if __name__ == '__main__':
    text = '''喜羊羊美羊羊懒羊羊沸羊羊
慢羊羊软绵绵
红太狼灰太狼

别看我只是一只羊

绿草因为我变得更香

天空因为我变得更蓝

白云因为我变得柔软

别看我只是一只羊

羊儿的聪明难以想象

天再高心情一样奔放

每天都追赶太阳'''
    output_file_path = '../results/example05.mp4'
    xyyVideoClip = VideoFileClip('../videos/xyy_part.mp4')
    finalClip = add_subtitles(xyyVideoClip, text)
    finalClip.write_videofile(output_file_path, fps=25, codec="libx264", audio_codec="aac")
